package org.kailu.book.entity;
// default package
// Generated May 24, 2014 1:38:24 PM by Hibernate Tools 4.0.0

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Proxy;

/**
 * Language generated by hbm2java
 */
@Entity
@Proxy(lazy=false)
@Table(name = "language", catalog = "book")
public class LanguageEntity implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Integer languageId;
	private String languageName;
	private Set<BookEntity> books = new HashSet<BookEntity>(0);

	public LanguageEntity() {
	}

	public LanguageEntity(String languageName) {
		this.languageName = languageName;
	}

	public LanguageEntity(String languageName, Set<BookEntity> books) {
		this.languageName = languageName;
		this.books = books;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "language_id", unique = true, nullable = false)
	public Integer getLanguageId() {
		return this.languageId;
	}

	public void setLanguageId(Integer languageId) {
		this.languageId = languageId;
	}

	@Column(name = "language_name", nullable = false, length = 50)
	public String getLanguageName() {
		return this.languageName;
	}

	public void setLanguageName(String languageName) {
		this.languageName = languageName;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "language")
	public Set<BookEntity> getBooks() {
		return this.books;
	}

	public void setBooks(Set<BookEntity> books) {
		this.books = books;
	}

}
